🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / feature / map / src / commonMain / kotlin / org / meshtastic / feature / map / component / SitePlannerBrowserSheet.kt
Displaying Raw • Download
feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/SitePlannerBrowserSheet.kt renovate/fastlane-2.x-lockfile (056eed64) Text, 3.87 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.feature.map.component
Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787androidx.compose.runtime.getValue
Tff7b72import T7ee787androidx.compose.runtime.mutableStateOf
Tff7b72import T7ee787androidx.compose.runtime.remember
Tff7b72import T7ee787androidx.compose.runtime.setValue
Tff7b72import T7ee787androidx.compose.ui.platform.LocalUriHandler
Tff7b72import T7ee787org.jetbrains.compose.resources.stringResource
Tff7b72import T7ee787org.meshtastic.core.resources.Res
Tff7b72import T7ee787org.meshtastic.core.resources.site_planner_browser_note
T8b949e/** The hosted Site Planner. One definition, shared by the embedded host and the browser hand-off. */
Tff7b72const Tff7b72val Te6edf3SITE_PLANNER_URLTb4b4b4: Tffa657String Tff7b72= Ta5d6ff"Ta5d6ffhttps://site.meshtastic.orgTa5d6ff"
T8b949e/**
* The Site Planner as a form that hands the finished parameters to the system browser.
*
* Used where there is no embedded browser to run the planner in. The whole configuration step is the same
* [SitePlannerSheet] the Android hosts show, so the transmitter is still seeded from the connected radio and the
* shortcuts still work; only the last step differs — instead of loading the planner in place, the parameters are
* encoded into its URL and opened outside the app.
*
* The coverage estimate therefore stays in the browser rather than returning as a map layer. Bringing it back
* automatically needs a JavaScript bridge, which needs an embedded browser: on Desktop that meant bundling Chromium,
* which measured at roughly three and a half times the size of the whole application.
*
* It comes back by hand instead, which the sheet's note spells out: the planner's own export writes a `.geojson`, and
* the layers sheet on this same host imports it. The note names the format on purpose — the planner's KML export is a
* bare `<GroundOverlay>` over a sibling PNG that arrives without its image, so a user who reached for it would import a
* file that draws nothing.
*/
Tf0883e@Composable
Tff7b72fun Td2a8ffSitePlannerBrowserSheetTb4b4b4(
Te6edf3initialTb4b4b4: Te6edf3SitePlannerParamsTb4b4b4,
Te6edf3onDismissTb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Te6edf3onUseNodeLocationTb4b4b4: Tb4b4b4(Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Te6edf3PairTff7b72<Tffa657DoubleTb4b4b4, Tffa657DoubleTff7b72>Tb4b4b4)Tff7b72? Tff7b72= Tff7b72nullTb4b4b4,
Te6edf3onUseMapCenterTb4b4b4: Tb4b4b4(Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Te6edf3PairTff7b72<Tffa657DoubleTb4b4b4, Tffa657DoubleTff7b72>Tb4b4b4)Tff7b72? Tff7b72= Tff7b72nullTb4b4b4,
Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3uriHandler Tff7b72= Te6edf3LocalUriHandlerTb4b4b4.Te6edf3current
T8b949e// Held here rather than passed straight through: the sheet re-seeds its coordinate fields from `initial`, so a
T8b949e// location shortcut only shows up if the caller actually moves the value it was given.
Tff7b72var Te6edf3params Tff7b72by Te6edf3rememberTb4b4b4(Te6edf3initialTb4b4b4) Tb4b4b4{ Te6edf3mutableStateOfTb4b4b4(Te6edf3initialTb4b4b4) Tb4b4b4}
Te6edf3SitePlannerSheetTb4b4b4(
Te6edf3initial Tff7b72= Te6edf3paramsTb4b4b4,
Te6edf3onSubmit Tff7b72= Tb4b4b4{ Te6edf3submitted Tff7b72-Tff7b72>
Te6edf3uriHandlerTb4b4b4.Te6edf3openUriTb4b4b4(Te6edf3submittedTb4b4b4.Te6edf3toQueryUrlTb4b4b4(Te6edf3SITE_PLANNER_URLTb4b4b4, Te6edf3useHostBridge Tff7b72= Tff7b72falseTb4b4b4)Tb4b4b4)
Te6edf3onDismissTb4b4b4(Tb4b4b4)
Tb4b4b4}Tb4b4b4,
Te6edf3onDismiss Tff7b72= Te6edf3onDismissTb4b4b4,
Te6edf3note Tff7b72= Te6edf3stringResourceTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3site_planner_browser_noteTb4b4b4)Tb4b4b4,
Te6edf3onUseNodeLocation Tff7b72=
Te6edf3onUseNodeLocationTff7b72?.Te6edf3let Tb4b4b4{ Te6edf3node Tff7b72-Tff7b72>
Tb4b4b4{
Tff7b72val Tb4b4b4(Te6edf3latitudeTb4b4b4, Te6edf3longitudeTb4b4b4) Tff7b72= Te6edf3nodeTb4b4b4(Tb4b4b4)
Te6edf3params Tff7b72= Te6edf3paramsTb4b4b4.Te6edf3copyTb4b4b4(Te6edf3latitude Tff7b72= Te6edf3latitudeTb4b4b4, Te6edf3longitude Tff7b72= Te6edf3longitudeTb4b4b4)
Tb4b4b4}
Tb4b4b4}Tb4b4b4,
Te6edf3onUseMapCenter Tff7b72=
Te6edf3onUseMapCenterTff7b72?.Te6edf3let Tb4b4b4{ Te6edf3center Tff7b72-Tff7b72>
Tb4b4b4{
Tff7b72val Tb4b4b4(Te6edf3latitudeTb4b4b4, Te6edf3longitudeTb4b4b4) Tff7b72= Te6edf3centerTb4b4b4(Tb4b4b4)
Te6edf3params Tff7b72= Te6edf3paramsTb4b4b4.Te6edf3copyTb4b4b4(Te6edf3latitude Tff7b72= Te6edf3latitudeTb4b4b4, Te6edf3longitude Tff7b72= Te6edf3longitudeTb4b4b4)
Tb4b4b4}
Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Served by rngit 1.5.2 - Generated in 0.12s